package domain;
/*
封装数据的类
javabean   domain 包
品牌 String brand
价格 double price
颜色 String color
类型 String type
 */
public class Car {
    private String brand;
    private double price;
    private String color;
    private String type;

    public Car() {
    }

    public Car(String brand, double price, String color, String type) {
        this.brand = brand;
        this.price = price;
        this.color = color;
        this.type = type;
    }


    public String getBrand() {
        return brand;
    }

    public void setBrand(String brand) {
        this.brand = brand;
    }

    public double getPrice() {
        return price;
    }

    public void setPrice(double price) {
        this.price = price;
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
    /*
    写了toString 打印对象就是 内容
    不写  打印对象 就是地址值
     */
    @Override
    public String toString() {
        return "Car{" +
                "brand='" + brand + '\'' +
                ", price=" + price +
                ", color='" + color + '\'' +
                ", type='" + type + '\'' +
                '}';
    }
}
